package com.aiphome.repository;

import com.aiphome.model.Product;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

@Repository
public interface ProductRepository extends JpaRepository<Product, Long> {
    
    List<Product> findByActiveTrue();
    
    List<Product> findByCategory(String category);
    
    Optional<Product> findByName(String name);
    
    List<Product> findByPriceBetween(Double minPrice, Double maxPrice);
    
    List<Product> findTop5ByOrderByIdAsc();
    
    List<Product> findByCategoryAndActiveTrue(String category);
}